package com.quanxi.qxaimain.common.globalException;

/**
 * @Author lyx
 * @create 2022/9/1 16:02
 * 自定义异常继承类
 */

public class GlobalException extends Exception{
    private int code;
    private String msg;
    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    //  自定义异常
    public GlobalException(String message, int code, String msg){
        super(message);
        // 状态码
        this.code =code;
        // 状态码配套的msg
        this.msg = msg;

    }

    // 默认异常
    public GlobalException(String message){
        super(message);
        this.code =ResultCode.FAILED.getCode();
        this.msg = ResultCode.FAILED.getMsg();
    }


}